package com.zhisheng.restcontrolleradvice;

/*
    全哥
*/

import com.zhisheng.exception.MyBusinessException;
import com.zhisheng.result.MyResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyRestControllerAdvice {

    @ExceptionHandler(MyBusinessException.class)
    public MyResponseResult<String> handleException(MyBusinessException e) {
        e.printStackTrace();
        return  MyResponseResult.fail(e.getMessage());
    }

}
